<?php /*
<div class="ui-bar  ui-widget ui-widget-content ui-corner-all">
<a class="ui-button ui-widget-content ui-state-default ui-corner-all" href="<?php
            echo $this->url(
                array('module' => 'default',
                      'controller'=>'user',
                      'action'=>'add'),
                'default', true)
                ?>"
                ><?php echo  $this->translate('Add user'); ?></a>
</div>
*/ ?>

<div class="ui-bar  ui-widget ui-widget-content ui-corner-all">
    <?php echo $this->filterForm; ?>

</div>
<div class="ui-grid ui-widget ui-widget-content ui-corner-all">
<div class="ui-grid-header ui-widget-header ui-corner-top"><?php echo  $this->translate('Specials'); ?></div>
<table class="ui-grid-content ui-widget-content" >
<thead>
    <tr>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'catalog',
                                                 'controller'=>'special',
                                                 'action'=>'admin',
                                                 'sort'=>'p.title'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Product'); ?>
            </a>
        </th>

        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'catalog',
                                                 'controller'=>'special',
                                                 'action'=>'admin',
                                                 'sort'=>'p.price'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Default price'); ?>
            </a>
        </th>


        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'catalog',
                                                 'controller'=>'special',
                                                 'action'=>'admin',
                                                 'sort'=>'s.price'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Special price'); ?>
            </a>
        </th>


        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'catalog',
                                                 'controller'=>'special',
                                                 'action'=>'admin',
                                                 'sort'=>'s.start_at'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('From'); ?>
            </a>
        </th>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'catalog',
                                                 'controller'=>'special',
                                                 'action'=>'admin',
                                                 'sort'=>'s.end_at'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Till'); ?>
            </a>
        </th>
        <th class="ui-state-default"><?php echo $this->translate('Edit'); ?></th>
    </tr>
</thead>
<tbody>
    <?php if(count($this->specials)): foreach($this->specials as $special):?>
    <tr>
        <td class="ui-widget-content"><?php echo $special['Product']['title']; ?></td>
        <td class="ui-widget-content"><strike> <?php echo $special['Product']['price']; ?> </strike></td>
        <td class="ui-widget-content"><?php echo $special['price']; ?></td>
        <td class="ui-widget-content"><?php echo $special['start_at']; ?></td>
        <td class="ui-widget-content"><?php echo $special['end_at']; ?></td>
        <td class="ui-widget-content">

        <a href="<?php
            echo $this->url(array('module' => 'catalog',
                                  'controller'=>'special',
                                  'action'=>'edit',
                                  'special_id'=>$special['id']),
                'default', true)
                ?>"><?php echo  $this->translate('Edit'); ?></a>

            <a href="<?php
            echo $this->url(array('module' => 'catalog',
                                  'controller'=>'special',
                                  'action'=>'delete',
                                  'special_id'=>$special['id']),
                'default', true)
                ?>"><?php echo  $this->translate('Delete'); ?></a>
        </td>
    </tr>
    <?php endforeach;  else:  ?>
    <tr>
        <td class="ui-widget-content ui-grid-empty" colspan="6">
            <?php echo $this->translate('No specials'); ?>
        </td>
    </tr>
    <?php endif;?>
    </tbody>
</table>

<div class="ui-grid-footer ui-widget-header ui-corner-bottom ui-helper-clearfix">
    <?php echo $this->paginationControl($this->specials); ?>
</div>
</div>

